package com.theo.config;

import com.theo.entity.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration  //当前类是一个配置类
public class UserConfig {

    @Bean   //构建一个实例，放到spring容器中
    public User user() {
        User user = new User();
        user.setId(1);
        user.setUsername("theofang");
        return user;
    }

    /*
    <beans>
        <bean id = "user" class = "com.theo.entity.User"/>
    </beans>
     */
}
